# -*- coding: utf-8 -*-
import datetime

import GetMysql
from MysqlHelp import DB


def test1(frequency):

    # 查询fmlocation表中,该频率是否存在
    # print(fre)
    with DB(host='47.92.33.19',user='root',passwd='1qazxsw2',db='database_fm') as db:

        db.execute("select frequency,fmcoding,lng,lat FROM fm_t_radiolist WHERE frequency={} and ban_time is NULL order by create_time desc".format(frequency))

        codingfrequencydict = db.fetchall()



        if len(codingfrequencydict) > 0:
            return codingfrequencydict
        else:

            return None
def runtime():
    # nowtime = str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")).replace('-','').replace(':','').replace(' ','')
    # print(nowtime)
    # result = test1('107.7')
    # print(len(result))
    # for data in result:
    #     print(data)

    res = GetMysql.sel_radiolist('99')
    print(res)

if __name__ == '__main__':
    runtime()